/*
https://leetcode.cn/problems/koko-eating-bananas/submissions/567664260/
*/
class Solution {
public:
    int minEatingSpeed(vector<int>& piles, int days) {
    long long l=1, r=1000000000;
        while(l<r){
            long long  mid=(l+r)/2;
            double  count=0;
            for(long long i:piles){
                count += (i + mid - 1) / mid;
            }
            if(count<=days){
                r=mid;
            }
            else l=mid+1;
        }
        return l;
    }
};